﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="TransactionPage.aspx.cs" Inherits="MAA.Presentation.PRL.Trading.TransactionPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="../Styles/Transaction.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="buy">
        <h2>
            <asp:Label ID="langSell" runat="server" Text="<%$Resources:language, langSell%>"></asp:Label></h2>
        <li>
            <div class="root">
                <asp:Label ID="langAllPost" runat="server" Text="<%$Resources:language, langAllPost%>"></asp:Label>
            </div>
            <asp:Label runat="server" ID="lblNumPost"></asp:Label><br />
        </li>
        <li>
            <div class="entry">
                <asp:Label ID="langPostProcessing" runat="server" Text="<%$Resources:language, langPostProcessing%>"></asp:Label>
            </div>
            <asp:Label runat="server" ID="lblNumPostTrading"></asp:Label><br />
        </li>
        <li>
            <div class="entry">
                <asp:Label ID="langPostSucess" runat="server" Text="<%$Resources:language, langPostSucess%>"></asp:Label>
            </div>
            <asp:Label runat="server" ID="lblNumPostSuccess"></asp:Label><br />
        </li>
        <li>
            <div class="entry">
                <asp:Label ID="langPostExpiration" runat="server" Text="<%$Resources:language, langPostExpiration%>"></asp:Label>
            </div>
            <asp:Label runat="server" ID="lblNumPostExpired"></asp:Label>
        </li>
        <div class="filter">
            <asp:Label ID="langRiceType" runat="server" Text="<%$Resources:language, langRiceType%>"></asp:Label>
            <br />
            <asp:DropDownList Width="100%" runat="server" ID="ddlRiceTypePost" AutoPostBack="True"
                OnSelectedIndexChanged="SelectedIndexChanged_Post">
            </asp:DropDownList>
        </div>
        <div class="filter">
            <asp:Label ID="langProvince" runat="server" Text="<%$Resources:language, langProvince%>"></asp:Label>
            <br />
            <asp:DropDownList Width="100%" runat="server" ID="ddlProvincePost" AutoPostBack="True"
                OnSelectedIndexChanged="SelectedIndexChanged_Post">
            </asp:DropDownList>
        </div>
        <div class="filter">
            <asp:Label ID="langStatus" runat="server" Text="<%$Resources:language, langStatus%>"></asp:Label>
            <br />
            <asp:DropDownList Width="100%" runat="server" ID="ddlStatusPost" AutoPostBack="True"
                OnSelectedIndexChanged="SelectedIndexChanged_Post">
                <asp:ListItem Selected="True" Value="0">-Tất cả-</asp:ListItem>
                <asp:ListItem Value="1">Đang giao dịch</asp:ListItem>
                <asp:ListItem Value="2">Thành công</asp:ListItem>
                <asp:ListItem Value="3">Hết hạn</asp:ListItem>
            </asp:DropDownList>
        </div>
        <br />
        <asp:Label ID="lblPostsMess" runat="server" ForeColor="Red" Text=""></asp:Label>
        <br />
        <asp:GridView ID="dgvTransactionPost" runat="server" CellPadding="4" ForeColor="#333333"
            GridLines="None" AutoGenerateColumns="False" PageSize="20" BorderColor="#339933"
            BorderStyle="Solid" BorderWidth="1px" Style="width: 100%" 
                onrowdatabound="dgvTransactionPost_RowDataBound">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="PostID" HeaderText="PostID" Visible="False" />
                <asp:HyperLinkField DataNavigateUrlFields="PostID" DataNavigateUrlFormatString="~/PRL.Trading/PostPage.aspx?postID={0}"
                    DataTextField="RiceType" HeaderText="Loại gạo">
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemStyle HorizontalAlign="Left" />
                </asp:HyperLinkField>
                <asp:BoundField DataField="Amount" HeaderText="Số lượng (kg)" SortExpression="Amount">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="Price" HeaderText="Giá bán (vnđ)" SortExpression="Price">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="Province" HeaderText="Tỉnh/TP" SortExpression="Province">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="CreateDate" HeaderText="Ngày đăng" SortExpression="CreateDate">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="StatusID" HeaderText="StatusID" Visible="False" />
                <asp:BoundField DataField="Status" HeaderText="Trạng thái" SortExpression="Status">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="" ShowHeader="False" Visible="False">
                    <ItemTemplate>
                        <asp:ImageMap ID="imNotiPost" runat="server" Visible="False" ToolTip="Có người đặt hàng"
                            ImageUrl="~/WebData/Image/WebImage/Noti.png">
                        </asp:ImageMap>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EditRowStyle BackColor="#7C6F57" />
            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#cbfa84" Height="30px" />
            <SelectedRowStyle BackColor="#C5BBAF" ForeColor="#333333" Font-Bold="True" />
            <SortedAscendingCellStyle BackColor="#F8FAFA" />
            <SortedAscendingHeaderStyle BackColor="#246B61" />
            <SortedDescendingCellStyle BackColor="#D4DFE1" />
            <SortedDescendingHeaderStyle BackColor="#15524A" />
        </asp:GridView>
        <br />
        <asp:ImageButton ID="imgBtnFirst_Post" runat="server" ImageUrl="~/WebData/Image/WebImage/First.png"
            CommandArgument='First' OnClick="Page_Changed_Post" ToolTip="First" />
        <asp:ImageButton ID="imgBtnPrevious_Post" runat="server" ImageUrl="~/WebData/Image/WebImage/Previous.png"
            CommandArgument='Previous' OnClick="Page_Changed_Post" ToolTip="Previous" />
        <asp:Label ID="lblCurrentPage_Post" runat="server" Text="Label"></asp:Label>
        <asp:Label ID="lblSeperate_Post" runat="server" Text="/"></asp:Label>
        <asp:Label ID="lblTotalPage_Post" runat="server" Text="Label"></asp:Label>
        <asp:ImageButton ID="imgBtnNext_Post" runat="server" ImageUrl="~/WebData/Image/WebImage/Next.png"
            CommandArgument='Next' OnClick="Page_Changed_Post" ToolTip="Next" />
        <asp:ImageButton ID="imgBtnLast_Post" runat="server" ImageUrl="~/WebData/Image/WebImage/Last.png"
            CommandArgument='Last' OnClick="Page_Changed_Post" ToolTip="Last" />
        <br />
        <br />
    </div>
    <div class="sell">
        <h2>
            <asp:Label ID="langBuy" runat="server" Text="<%$Resources:language, langBuy %>"></asp:Label></h2>
        <li>
            <div class="root">
                <asp:Label ID="langAllOrder" runat="server" Text="<%$Resources:language, langAllOrder%>"></asp:Label>
            </div>
            <asp:Label runat="server" ID="lblNumOrder"></asp:Label><br />
        </li>
        <li>
            <div class="entry">
                <asp:Label ID="langOrderProcessing" runat="server" Text="<%$Resources:language, langOrderProcessing%>"></asp:Label>
            </div>
            <asp:Label runat="server" ID="lblNumOrderPending"></asp:Label><br />
        </li>
        <li>
            <div class="entry">
                <asp:Label  ID="langOrderSucess" runat="server" Text="<%$Resources:language, langOrderSucess%>"></asp:Label>
            </div>
            <asp:Label runat="server" ID="lblNumOrderAccept"></asp:Label><br />
        </li>
        <li>
            <div class="entry">
                <asp:Label ID="langOrderReject" runat="server" Text="<%$Resources:language, langOrderReject%>"></asp:Label>
            </div>
            <asp:Label runat="server" ID="lblNumOrderReject"></asp:Label>
        </li>
        <div class="filter">
            <asp:Label ID="langRiceTypeSell" runat="server" Text="<%$Resources:language, langRiceType%>"></asp:Label>
            <br />
            <asp:DropDownList Width="100%" runat="server" ID="ddlRiceTypeOrder" AutoPostBack="True"
                OnSelectedIndexChanged="SelectedIndexChanged_Order">
            </asp:DropDownList>
        </div>
        <div class="filter">
            <asp:Label ID="langProvinceSell" runat="server" Text="<%$Resources:language, langProvince%>"></asp:Label>
            <br />
            <asp:DropDownList Width="100%" runat="server" ID="ddlProvinceOrder" AutoPostBack="True"
                OnSelectedIndexChanged="SelectedIndexChanged_Order">
            </asp:DropDownList>
        </div>
        <div class="filter">
            <asp:Label ID="langStatusSell" runat="server" Text="<%$Resources:language, langStatus%>"></asp:Label>
            <br />
            <asp:DropDownList Width="100%" runat="server" ID="ddlStatusOrder" AutoPostBack="True"
                OnSelectedIndexChanged="SelectedIndexChanged_Order">
                <asp:ListItem Value="0">-Tất cả-</asp:ListItem>
                <asp:ListItem Value="1">Đang giao dịch</asp:ListItem>
                <asp:ListItem Value="2">Được chấp nhận</asp:ListItem>
                <asp:ListItem Value="3">Bị từ chối</asp:ListItem>
            </asp:DropDownList>
        </div>
        <br />
        <asp:Label ID="lblOrderMess" runat="server" ForeColor="Red" Text=""></asp:Label>
        <br />
        <asp:GridView ID="dgvTransactionOrder" runat="server" CellPadding="4" ForeColor="#333333"
            GridLines="None" AutoGenerateColumns="False" PageSize="20" BorderColor="#A11DC2"
            BorderStyle="Solid" BorderWidth="1px" Style="width: 100%" 
                onrowdatabound="dgvTransactionOrder_RowDataBound">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="OrderID" HeaderText="OrderID" Visible="False" />
                <asp:HyperLinkField DataTextField="RiceType" HeaderText="Loại gạo" DataNavigateUrlFields="OrderID"
                    DataNavigateUrlFormatString="~/PRL.Trading/OrderPage.aspx?orderID={0}">
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemStyle HorizontalAlign="Left" />
                </asp:HyperLinkField>
                <asp:BoundField DataField="Amount" HeaderText="Số lượng (kg)" SortExpression="Amount">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="Price" HeaderText="Giá mua (vnđ)" SortExpression="Price">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="Province" HeaderText="Tỉnh/TP" SortExpression="Province">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="CreateDate" HeaderText="Ngày đăng" SortExpression="CreateDate">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="StatusID" HeaderText="StatusID" Visible="False">
                    <HeaderStyle HorizontalAlign="Right" />
                    <ItemStyle HorizontalAlign="Right" />
                </asp:BoundField>
                <asp:BoundField DataField="Status" HeaderText="Trạng thái" 
                    SortExpression="Status" >
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
            </Columns>
            <EditRowStyle BackColor="#7C6F57" />
            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#d2bdf2" Height="30px" />
            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F8FAFA" />
            <SortedAscendingHeaderStyle BackColor="#246B61" />
            <SortedDescendingCellStyle BackColor="#D4DFE1" />
            <SortedDescendingHeaderStyle BackColor="#15524A" />
        </asp:GridView>
        <br />
        <asp:ImageButton ID="imgBtnFirst_Order" runat="server" ImageUrl="~/WebData/Image/WebImage/First.png"
            CommandArgument='First' OnClick="Page_Changed_Order" ToolTip="First" />
        <asp:ImageButton ID="imgBtnPrevious_Order" runat="server" ImageUrl="~/WebData/Image/WebImage/Previous.png"
            CommandArgument='Previous' OnClick="Page_Changed_Order" ToolTip="Previous" />
        <asp:Label ID="lblCurrentPage_Order" runat="server" Text="Label"></asp:Label>
        <asp:Label ID="lblSeperate_Order" runat="server" Text="/"></asp:Label>
        <asp:Label ID="lblTotalPage_Order" runat="server" Text="Label"></asp:Label>
        <asp:ImageButton ID="imgBtnNext_Order" runat="server" ImageUrl="~/WebData/Image/WebImage/Next.png"
            CommandArgument='Next' OnClick="Page_Changed_Order" ToolTip="Next" />
        <asp:ImageButton ID="imgBtnLast_Order" runat="server" ImageUrl="~/WebData/Image/WebImage/Last.png"
            CommandArgument='Last' OnClick="Page_Changed_Order" ToolTip="Last" />
        <br />
        <br />
    </div>
</asp:Content>
